import Cookies from "js-cookie";

const TOKEN_KEY = "token";

/**
 * 将登录凭证保存到cookie
 * @param token
 */
export function saveLoginToken2Cookie(token) {
  Cookies.set(TOKEN_KEY, token);
}

/**
 * 从cookie中获取登录凭证
 * @return {*}
 */
export function loadLoginTokenFromCookie() {
  return Cookies.get(TOKEN_KEY);
}
